
function doPrint() {
	bdhtml = window.document.body.innerHTML;
	sprnstr = "<!--startprint-->";
	eprnstr = "<!--endprint-->";
	prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
	prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
	window.document.body.innerHTML = prnhtml;
	window.print();
}

//给指定的表格添加一行  
function addRow(TableName) {
	var table = document.getElementById(TableName);
//添加一行
	var tr_node = document.createElement("tr");
//设置列数组
	var td_node = new Array(4);
	var td_node_id = new Array("ok", "nook", "jianpi", "hepi");
	var td_node_width = new Array("20%", "20%", "20%", "20%");
	input_node_type = "Input";
//添加列
	for (i = 0; i < 4; i++) {
		td_node[i] = document.createElement("td");
		td_node[i].setAttribute("id", TableName + td_node_id[i]);
		td_node[i].setAttribute("width", td_node_width[i]);
	}
//添加列的内容和内容的属性，此处是新建一个Input框，并放入单元格中。
	for (i = 0; i < 4; i++) {
		var input_node = document.createElement("input");
		input_node.setAttribute("type", input_node_type);
		input_node.setAttribute("id", TableName + td_node_id[i] + "Input");
		td_node[i].appendChild(input_node);
		tr_node.appendChild(td_node[i]);
	}

//将新建的行元素增加到表格中
	table.appendChild(tr_node);
}
function showandhidden(Dviid) {
	allhide();
	if (!isIE()) {
		document.getElementById(Dviid).style.display = "";
	} else {
		document.getElementById(Dviid).style.display = "block";
	}
}
function allhide() {
	document.getElementById("tbody1").style.display = "none";
	document.getElementById("tbody2").style.display = "none";
	document.getElementById("tbody3").style.display = "none";
	document.getElementById("tbody4").style.display = "none";
	document.getElementById("tbody5").style.display = "none";
	document.getElementById("tbody6").style.display = "none";
	document.getElementById("tbody7").style.display = "none";
	document.getElementById("tbody8").style.display = "none";
	return;
}
function isIE() { //ie?
	if (window.navigator.userAgent.toLowerCase().indexOf("msie") >= 1) {
		return true;
	} else {
		return false;
	}
}
function test() {
	var old = null;
	function changemenu(mydiv) {
		var obj = document.getElementById(mydiv);
		if (old != null && old != obj) {
			old.style.display = "none";
		}
		old = obj;
		if (obj.style.display == "none") {
			obj.style.display = "block";
		} else {
			obj.style.display = "none";
		}
	}
}

